#ifndef _ELF_READER_H
#define _ELF_READER_H
#include <elf.h>
#include <stdlib.h>
#include "base.h"
#include <vector>
using namespace std;

namespace ELF {
    class Reader {
        private:
            char* mPath;
            int fd;
            void* buff;
            u8 buffSize;
            Elf32_Ehdr* ehdr;
            Elf32_Shdr* shdrs;
            Elf32_Dyn*  dyn;
            const char* strtab;
            u4 dynSize;

        public:
            Reader(char* buf,u8 buf_size){
                buff=buf;
                buffSize=buf_size;
            }
            ~Reader();
            bool parseELF();
            bool replaceDebugAndRet(char**);

            void* getBuff();
            u8 getBuffSize();
    };

    int changeSo(char*, char*);
}
#endif